package com.yazi.mxz.fieldsale.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.myframework.smhj.jackson.result.ObjectResult;
import com.yazi.mxz.fieldsale.entity.beans.Version;
import com.yazi.mxz.fieldsale.repository.StoreGoodsRepository;

@Controller("VersionController")
@RequestMapping("/version")
public class VersionController extends BaseController {
	
	@Resource
	StoreGoodsRepository storeGoodsRepository;
	
	@RequestMapping("/get/json")
	@ResponseBody
	public ObjectResult<?> getJson() {
		ObjectResult<Version> jsonResult = new ObjectResult<Version>();
		try {
			jsonResult.setResult(getVersion());
			jsonResult.setOk();
		} catch (Exception e) {
			jsonResult.setErrorMessage(e.getMessage());
		}
		return jsonResult;
	}
	
}
